﻿using System.Collections.Generic;

namespace RMH.DataAccess
{
    public interface IRepository
    {
        void BeginTransaction();
        void CommitTransaction();
        void RollbackTransaction();
        void Flush();
    }

    public interface IRepository<T> : IRepository
    {        
        void Clear();
        void Save(T entity);
        void Delete(T entity);
        void SaveOrUpdate(T entity);
        T GetFirst();
        T GetByID(object ID);        
        IList<T> GetAll();
        IList<T> GetAll(int pageNumber, int pageSize);
        T GetBy(string propertyName, object value);
        IList<T> FindAll(IDictionary<string, object> propertyValuePairs);
        T FindOne(IDictionary<string, object> propertyValuePairs);
        void Evict(object item);
    }
}
